using System;
using System.ComponentModel.DataAnnotations;

namespace Homework8.Models
{
    public class Student
    {
        public int StudentId { get; set; }
        
        [Required(ErrorMessage = "学生姓名不能为空")]
        public string Name { get; set; } = string.Empty;
        
        public int? Age { get; set; }
        
        public string? Gender { get; set; }
        
        public int ClassId { get; set; }
        
        public string? EnrollmentDate { get; set; }
        
        public string? Address { get; set; }
        
        public string? ContactInfo { get; set; }
        
        // 导航属性
        public Class? Class { get; set; }
    }
} 